package com.example.httplibrary.mvp.proxy;




import com.example.httplibrary.mvp.BasePresenter;
import com.example.httplibrary.mvp.BaseView;

import androidx.appcompat.app.AppCompatActivity;


/**
 * Author: 李巷阳
 * Date: 2020/6/6
 * Part:
 * Description:
 */
public class ActivityMvpProxyImpl<V extends BaseView> extends MvpProxyImpl<V> implements ActivityMvpProxy {
    public ActivityMvpProxyImpl(V view) {
        super(view);
    }

    public void bindAndCreatePresenter(AppCompatActivity mActivity) {
        super.bindAndCreatePresenter();
        // 一定要解绑
        for (BasePresenter presenter : mPresenters) {
            // 利用Lifecycle 把activity生命周期绑定至Presenter
            mActivity.getLifecycle().addObserver(presenter);

        }
    }




}
